FILE *logfile;
int loglevel;
-#ifdef MAPCACHE
-pthread_mutex_t mapcache_mutex;
-#endif
-
void cpu_exec_init(CPUState *env)
{
CPUState **penv;
int cpu_index;
-#ifdef MAPCACHE
- pthread_mutexattr_t mxattr;
-#endif
env->next_cpu = NULL;
penv = &first_cpu;
/* alloc dirty bits array */
phys_ram_dirty = qemu_malloc(phys_ram_size >> TARGET_PAGE_BITS);
-
-#ifdef MAPCACHE
- /* setup memory access mutex to protect mapcache */
- pthread_mutexattr_init(&mxattr);
- pthread_mutexattr_settype(&mxattr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mapcache_mutex, &mxattr);
- pthread_mutexattr_destroy(&mxattr);
-#endif
}
/* enable or disable low levels log */
#if defined(__i386__) || defined(__x86_64__)
-
#define MAPCACHE
-
uint8_t *qemu_map_cache(target_phys_addr_t phys_addr);
void qemu_invalidate_map_cache(void);
-
-#include <pthread.h>
-extern pthread_mutex_t mapcache_mutex;
-#define mapcache_lock() pthread_mutex_lock(&mapcache_mutex)
-#define mapcache_unlock() pthread_mutex_unlock(&mapcache_mutex)
-
#else
-
#define qemu_invalidate_map_cache() ((void)0)
+#endif
#define mapcache_lock() ((void)0)
#define mapcache_unlock() ((void)0)
-#endif
-
extern int xc_handle;
extern int domid;